package routers

import (
	"github.com/gin-gonic/gin"
	"movie-schedul/harst"
)

func Cors() gin.HandlerFunc {
	return func(c *gin.Context) {
		c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
	}
}
func Init() *gin.Engine {
	r := gin.Default()
	r.Use(Cors())
	r.Static("static", "./static")
	r.POST("/login", harst.Login)
	r.GET("/list", harst.List)

	return r
}
